import java.util.*;

class myCalendar180405114 {
    static public String className="计算机1801";
    private Integer yy;
    private Integer dd;
    private Integer mm;

    public myCalendar180405114(int yy, int dd, int mm) {
        this.yy=yy;
        this.dd=dd;
        this.mm=mm;
    }

    int getYY() { return yy; }
    int getDD() { return dd; }
    int getMM() { return mm; }

    public boolean equals(Object o) {
        myCalendar180405114 ro=(myCalendar180405114)o;
        return o.yy==this.yy && o.dd==this.dd && o.mm==this.mm;
    }

    public int hashCode() {
        return this.yy*365+this.dd*31+this.mm;
    }

    public String toString() {
        return this.yy.toString()+" "+this.dd.toString()+" "+this.mm.toString();
    }
}

class myComparator implements Comparator<myCalendar180405114> {
    static private int compareLogic(int n1, int n2) {
        if(n1<n2)
            return -1;
        else if(n1>n2)
            return 1;
        else
            return 0;
    }
    
    @Override
    public int compare(myCalendar180405114 o1, myCalendar180405114 o2) {
        if(o1.getYY()!=o2.getYY())
            return compareLogic(o1.getYY(), o2.getYY());
        else if(o1.getDD()!=o2.getDD())
            return compareLogic(o1.getDD(), o2.getDD());
        else
            return compareLogic(o1.getMM(), o2.getMM());
    }
}

class demo {
    public static void testPrint(ArrayList<myCalendar180405114> testList) {
        for(var r : testList)
            System.out.println(r);
        System.out.println("END");
    }

    private ArrayList<myCalendar180405114> testList;

    public demo() {
        this.testList=new ArrayList<myCalendar180405114>();
        testList.add(new myCalendar180405114(2018, 1, 1));
        testList.add(new myCalendar180405114(2019, 2, 10));
        testList.add(new myCalendar180405114(2020, 2, 9));
        testList.add(new myCalendar180405114(2020, 1, 1));
        testList.add(new myCalendar180405114(2018, 2, 10));
        testList.add(new myCalendar180405114(2019, 2, 9));
        testList.add(new myCalendar180405114(2020, 2, 10));
        testList.add(new myCalendar180405114(2018, 2, 9));
        testList.add(new myCalendar180405114(2019, 1, 1));
    }
    
    public void testSort() {
        testPrint(this.testList);

        Collections.sort(this.testList, new myComparator());
        testPrint(this.testList);
    }

    public void outputClass() {
        System.out.println(this.testList.get(0).className);
        System.out.println(myCalendar180405114.class.getName());
    }
}

public class test2 {
    public static void main(String[] args) {
        demo d=new demo();
        d.testSort();
        d.outputClass();
    }
}
